﻿using System;
using System.ComponentModel.DataAnnotations;
using Abp.Domain.Entities.Auditing;

namespace DHJ.Cost.Models
{
    /// <inheritdoc />
    /// <summary>
    /// 产品发次
    /// </summary>
    public class Launch : FullAuditedEntity
    {
        protected Launch()
        {
        }

        public Launch(int modelId, string code, string name, string description, DevelopmentStage stage)
        {
            ModelId = modelId;
            Code = code.Trim().ToUpper();
            Name = name;
            Description = description;
            Stage = stage;
        }

        /// <summary>
        /// 型号Id
        /// </summary>
        [Required]
        public int ModelId { get; set; }
        public Model Model { get; set; }

        /// <summary>
        /// 发次代号
        /// </summary>
        [Required]
        public string Code { get; set; }

        /// <summary>
        /// 发次名称
        /// </summary>
        [Required]
        public string Name { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [MaxLength(CostConsts.MaxEntityDescriptionLength)]
        public string Description { get; set; }

        /// <summary>
        /// 研制阶段
        /// </summary>
        public DevelopmentStage Stage { get; set; }

        /// <summary>
        /// 计划齐套日期
        /// </summary>
        public DateTime PlannedCompletionDate { get; set; }

        /// <summary>
        /// 计划完成日期
        /// </summary>
        public DateTime PlannedFinishDate { get; set; }

        /// <summary>
        /// 计划交付日期
        /// </summary>
        public DateTime PlannedDeliveryDate { get; set; }

        /// <summary>
        /// 齐套顺序
        /// </summary>
        public int CompletionPriority { get; set; }
    }
}